import request from "@/utills/request";

export const getLoginState=(data: any)=>{
  return request({
    method: "POST",
    url: "/api/auth/getLoginState",
    data,
  })
}

export const getJobIndustry=()=>{
  return request({
    method: "POST",
    url: "/api/auth/getJobIndustry",
    // data,
  })
}

export const getFilterEs=(data:any)=>{
  return request({
    method: "POST",
    url: "/api/auth/getFilterEs",
    data,
  })
}
export const searchEnterprises=(data:any)=>{
  return request({
    method: "POST",
    url: "/api/auth/searchEnterprises",
    data,
  })
}

export const getFilterJobs=(data: any)=>{
  return request({
    method: "POST",
    url: "/api/auth/getFilterJobs",
    data,
  })
}
export const searchJobs=(data: any)=>{
  return request({
    method: "POST",
    url: "/api/auth/searchJobs",
    data,
  })
}

export function getHRAvatar(data: any) {
  return request({
    method: "POST",
    url: "/api/auth/getHRAvatar",
    responseType: "blob",
    data,
  })
}
export function getAvatar(data: any) {
  return request({
    method: "POST",
    url: "/api/auth/getAvatar",
    responseType: "blob",
    data,
  }).catch(() => { })
}

export function getOneEInfo(data: any) {
  return request({
    method: "POST",
    url: "/api/auth/getOneEInfo",
    data,
  })
}

export function getAllEInfo() {
  return request({
    method: "GET",
    url: "/api/auth/getAllEInfo",
  }).catch(e => { })
}

export const  getAllJobInfo=()=> {
  return request({
    method: "GET",
    url: "/api/auth/getAllJobInfo",
  })
}

export function adminLogin(data: any) {
  return request({
    method: "POST",
    url: "/api/auth/adminLogin",
    data,
  })
}

// 获取主页banner图片
export const getBanner = ((data: any) => {
  return request({
    method: "post",
    url: "/api/auth/getBanner",
    responseType: "blob",
    data
  })
})

// 获取主页菜单
export function getHomeMenu() {
  return request({
    method: "get",
    url: "/api/auth/getHomeMenu",
  })
}
// 登录
export function login(data: any) {
  return request({
    method: "POST",
    url: "/api/auth/login",
    data,
  })
}

// 获取所有公司名称
export function getAllE() {
  return request({
    method: "GET",
    url: "/api/auth/getAllE",
  })
}

// 注册
export function register(data: any) {
  return request({
    method: "POST",
    url: "/api/auth/register",
    data,
  })
}
// // 登录状态
// export function checkLogin(data: any) {
//   return request({
//     method: "POST",
//     url: "/api/auth/checkLogin/",
//     data,
//   })
// }
// 注销
export const  loginOu=(data: any)=>{
  return request({
    method: "POST",
    url: "/api/auth/loginOut",
    data,
  })
}

export default {
  login, register, loginOu, getAllE, adminLogin, getAvatar
}

